/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.sBean;

import com.aptech.entities.TblFeedback;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Winner
 */
@Stateless
public class TblFeedbackFacade extends AbstractFacade<TblFeedback> {

    @PersistenceContext(unitName = "Elevation_System_Online-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public TblFeedbackFacade() {
        super(TblFeedback.class);
    }
    public List<TblFeedback> getFeedbackByUserID(int usID) {
        Query query = em.createNamedQuery("TblFeedback.findByUser");
        query.setParameter("usID", usID);
        return query.getResultList();
    }
}
